#include "cxstartupwizard.h"
#include "ui_cxstartupwizard.h"
#include "cxglobal.h"
#include "CxSystemBuilder.h"
#include <QMessageBox>
#include <iostream>
using namespace std;
CxStartupWizard::CxStartupWizard(QWidget *parent) :
    QWizard(parent),
    ui(new Ui::CxStartupWizard)
{
    ui->setupUi(this);
    connect(this,SIGNAL(finished(int)),this,SLOT(on_finish(int)));
}

CxStartupWizard::~CxStartupWizard()
{
    delete ui;
}

void    CxStartupWizard::on_finish(int )
{
    CxGlobal  gl;
    CxSystemBuilder builder;
    gl.setIpAddr(0,ui->wizardPage_1->m_ipAddr[0].toStdString());
    gl.setIpAddr(1,ui->wizardPage_1->m_ipAddr[1].toStdString());
    gl.setIpAddr(2,ui->wizardPage_1->m_ipAddr[2].toStdString());
    gl.setIpAddr(3,ui->wizardPage_1->m_ipAddr[3].toStdString());

    gl.setPortnumber(0,ui->wizardPage_1->m_portNo[0]);
    gl.setPortnumber(1,ui->wizardPage_1->m_portNo[1]);
    gl.setPortnumber(2,ui->wizardPage_1->m_portNo[2]);
    gl.setPortnumber(3,ui->wizardPage_1->m_portNo[3]);

    sig_updateAll();
}
